<#-- 模型类的模板文件 -->
package ${package};

import cn.sccl.common.exception.BusinessException;
import cn.sccl.common.model.BaseModel;

/**
* ${tableComments}
* 数据库表 ${tableName} 的实体对象
* Created by ${author} on ${createDate}.
*/
public class ${model} extends BaseModel{
/**
*表名
*/
public final static String TABLE_NAME ="${tableName}";

<#list properties as p>
    <#if p.inBaseModel == false>
    private ${p.javaType} ${p.propertyName};//${p.comments}
    </#if>
</#list>

<#list properties as p>
    <#if p.inBaseModel == false>
    public void set${p.propertyName?cap_first}(${p.javaType} ${p.propertyName}){
    this.${p.propertyName} = ${p.propertyName};
    }

        <#if p.javaType == "boolean">
        public ${p.javaType} is${p.propertyName?cap_first}(){
        <#else>
        public ${p.javaType} get${p.propertyName?cap_first}(){
        </#if>
    return this.${p.propertyName};
    }
    </#if>
</#list>

/**
* clone一个对象。
* @param cls 需要克隆的对象类型，只能是当前类的子类
* @param
<T>
    * @return
    * @throws IllegalAccessException
    * @throws InstantiationException
    */
    public
    <T extends ${model}> T clone(Class
        <T> cls) {
            try {
            T t = cls.newInstance();
        <#list properties as p>
            t.set${p.propertyName?cap_first}(this.<#if p.javaType == "boolean">is<#else>
            get</#if>${p.propertyName?cap_first}());
        </#list>
            return t;
            } catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException("对象克隆失败，请克隆的目标对象是否具有无参的构造函数。", e.getCause());
            }
            }
            }